package com.example.test10mvc.controller;

import com.example.test10mvc.utils.RestResult;
import io.swagger.annotations.Scope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @Author: fxy
 * @Date: 2022/01/28/15:56
 * @Description:
 */
@RequestMapping("/demo2")
@RestController
public class Demo2Controller {
    @Resource
    public HttpServletRequest request;

    @GetMapping("/t1")
    public RestResult<Object> t1(){
        request.setAttribute("name","d2t1");
        System.out.println(request.getAttribute("name"));
        return null;
    }

    @GetMapping("/t2")
    public RestResult<Object> t2(){
        request.setAttribute("name","d2t2");
        System.out.println(request.getAttribute("name"));
        return null;
    }
}
